package com.example.wtt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.wtt.entity.Comments;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentsMapper extends BaseMapper<Comments> {

    @Select("SELECT COUNT(*) FROM comments WHERE dynamic_id = #{dynamicId};")
    Integer queryComment(Integer dynamicId);

    @Select("select * from comments where dynamic_id = #{dynamicId};")
    List<Comments> commentDetail(Integer dynamicId);
}
